package 抽象工厂;

import 抽象工厂.形状.Circle;
import 抽象工厂.形状.Rectangle;
import 抽象工厂.形状.Shape;
import 抽象工厂.形状.Square;
import 抽象工厂.颜色.Color;

/**
 * @author wz<br>
 * @version 1.0<br>
 * @ClassName ShapeFactory
 * @<Description> TODO
 * @date 2021/12/7 16:45<br>
 */
public class ShapeFactory extends AbstarctFactory{

  public Color getColor(String color) {
    return null;
  }

  public Shape getShape(String shapeType) {
    if(shapeType == null){
      return null;
    }
    if(shapeType.equalsIgnoreCase("CIRCLE")){
      return new Circle();
    } else if(shapeType.equalsIgnoreCase("RECTANGLE")){
      return new Rectangle();
    } else if(shapeType.equalsIgnoreCase("SQUARE")){
      return new Square();
    }
    return null;
  }
}
